package main

import (
	"io"
	"net/http"
)

func main() {
	var (
		err  error
		resp *http.Response
		all  []byte
	)
	defer func() {
		if err != nil {
			println(err.Error())
		}
	}()
	resp, err = http.Get("http://localhost:8000/ping")
	if err != nil {
		return
	}
	defer resp.Body.Close()
	all, err = io.ReadAll(resp.Body)
	if err != nil {
		return
	}
	println(string(all))
}
